<?php

/*
* 安装数据库
*/
class InstallAction extends Action{
	public function index(){		
		if($is_install){
			$this->error();
		}
		$m = M();
		$list = $m->query('show tables');
		dump($list);
		if(IS_POST){
			$sql = file_get_contents(APP_PATH.'dadao.sql');
			$sqlarr = explode('--------------------',$sql);
			$m = M();
			foreach($sqlarr as $v){
				$result = $m->execute($v);
			}
			$this->success('安装完成');exit();
		}
		$this->display();
	}
	
	
			
}